1. Field of the Invention
The present invention relates to a self-test circuit in an information processor, for internally testing the respective functional blocks of the information processor, and particularly to a self-test circuit which can efficiently test the functional blocks of the information processor with the use of test microprograms of small size.
2. Description of the Prior Art
In information processors, such as microprocessors employing a microprogram control system, various functional blocks such as ALUs, registers and shifters are controlled by microinstructions to process information and to input and output data through buses, thus realizing complicated and advanced functions and requirements.
FIG. 1 is a block diagram schematically showing an information processor adopting a conventional microprogram control system. In the figure, a microinstruction storage ROM (.mu. ROM) 1 stores microinstructions. According to an address given by a ROM address register (RAR) 3, each microinstruction is read out of the .mu. ROM 1 and set in a microinstruction register (MIR) 5. A microinstruction decoder (.mu. DEC) 7 decodes microinstructions sent from the MIR 5 and generates control signals to control a corresponding one of functional blocks.
Recently developed information processors tend to employ a high functional microprogram control system. Such a system uses high functional microinstructions, such as loop microinstructions, conditional branch microinstructions and subroutine branch microinstructions, to control various hardware blocks more efficiently. (Details of these microinstructions are not directly related to the present invention and, therefore, their circuits and functions are not shown explicitly in the accompanying figures.) By employing these microinstructions and their functions, effects of the present invention may be remarkably be improved. It is supposed, therefore, that the .mu. ROM 1 stores these high functional microinstructions.
Some of the information processors adopting the microprogram control system have test microprograms to self-test the their functional blocks. In the self-test, same functional blocks which can be controlled by microinstructions are used as input data generators for generating data to be used for the test.
It is common to use as the input data generators ROMs which are usually implemented in information processors. To more minutely and efficiently perform the self-test, linear feedback shift registers which can generate pseudo random test patterns, and registers which can shift data bit by bit, may be added as the input data generators to the information processors. These added registers are also controlled by microinstructions to generate input data.
The self-test is generally carried out according to a signature analysis method. According to this method, data generated by a data generator are inputted through a bus to a functional block to be tested. With respect to the inputted data, the functional block to be tested outputs data through the bus to a parallel input linear feedback shift register. The shift register repeatedly compresses the outputted data and provides signatures. The last signature is compared with expected value prepared in advance, to automatically judge whether or not a result of the test is correct.
A sequence of such a self-tests is written in a test microprogram in advance. By executing the test microprogram, the self-test is automatically carried out. Tests on functional blocks acting as input data generators can also be carried out by compressing outputs of the blocks and generating signatures based on the outputs.
A typical self-test method will be explained with reference to FIG. 1.
A hatched part of FIG. 1 of the .mu. ROM 1 stores test microprograms. The test microprograms are read out of the .mu. ROM 1 according to an externally provided signal and executed to carry out the self-test. This test method is realized without drastically modifying any hardware. As long as the ROM 1 has a vacant area, it is possible to store test microprograms. Therefore, this self-test method is easy to employ. However, if the size of the test microprograms is too large, the capacity of the ROM 1 must be increased to store them.
Registers and buses are represented with codes in the read and write fields of each microinstruction. Therefore, in carrying out tests of reading and writing each register, two microinstructions are needed. If the number of registers and buses is large, many microinstructions are needed to carry out tests on the registers and buses, thus the size of the test microprogram is increased.
FIGS. 2a and 2b show a second conventional self-test method which can carry out the self-test without drastically increasing the size of test microprograms.
In the figures, portions F1, F2, F3 and F4 of a microinstruction register (MIR) 5 function as linear feedback shift registers, respectively, to generate pseudo random patterns to be used as codes of test microinstructions.
In normal operation shown in FIG. 2a, the portions F1 to F4 of the microinstruction register 5 receive control signals each of, for instance, "0" from a control circuit 9 and output the respective codes of a microinstruction given by a ROM 1 as they are.
In the self-test shown in FIG. 2b, a predetermined one of the portions F1 to F4 of the microinstruction register 5, for example, the portion F3 receives a control signal of, for instance, 1, from the control circuit 9, and functions as a linear feedback shift register. In every unit cycle, for example, this linear feedback shift register generates a code for a test microinstruction. The other portions F1, F2 and F4 of the microinstruction register 5 output the codes of the test microinstruction given by the .mu. ROM 1 as they are.
According to the second conventional method, the portion of the microinstruction register 5 acting as the linear feedback shift register can generate plural test microinstructions having different codes. Therefore, the size of test microprograms stored in the .mu. ROM 1 may be small. In addition, the linear feedback shift register can be constituted only by making the microinstruction register 5 shiftable and by providing a feedback loop at a predetermined location. Therefore, this method may be realized without drastically extending hardware requirements, and is advantageous if the field structure of each microinstruction is simple.
Recent microprocessors tend to employ more complicated microinstructions. For such complicated microinstructions, the second conventional method needs more and complicated peripherals to be implemented for the microinstruction register 5, resulting in making control very difficult. In addition, in spite of the sophisticated structure, it is difficult to efficiently and accurately carry out the test, because a generating source of test data is limited to the linear feedback shift register. As the number of the peripherals of the microinstruction register 5 increase, hardware for the .mu. ROM 1 and microinstruction register 5 increase, to lower the operation margin of the ROM 1.
According to the first conventional self-test method, the self-test can be realized with a simple modification. But testing efficiency of microinstructions for normal operation is low, so that a large quantity of microinstructions are needed for sufficiently carrying out the self-test. Due to the increase in the number of the microinstructions, the capacity of the .mu. ROM1 for storing the microinstructions must inevitably be increased.
On the other hand, according to the second conventional self-test method, the self-test takes place with test programs of a relatively small size. However, if microinstructions contained in the test microprograms have complicated field structures, it will require more hardware and complicate control. Then, it will be difficult to efficiently and minutely carry out the self-test.